package cn.sunzq.springdata.elasticsearch.demo.importdata.service.controller;

import cn.sunzq.springdata.elasticsearch.demo.importdata.service.ImortService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @创建人 孙中泉
 * @创建时间 2021/7/19
 * @描述
 */
@RestController
@RequestMapping("test")
public class ImortServiceController {

    @Autowired
    private ImortService imortService;

    @RequestMapping(value = "/sync/{indexName}", method = RequestMethod.GET, produces = "application/json;charset=utf-8")
    public Boolean importDataToEs(@PathVariable("indexName") String indexName){
        return imortService.importDataToEs(indexName);
    }


}
